const express = require("express");
const app = express();
const port = 3111;
app.all("*", function (req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "*");
  res.header("Content-Type", "application/json;charset=utf-8");
  res.header("Access-Control-Allow-Methods", "PUT, POST, GET, DELETE, OPTIONS");
  next();
});
app.get("/aa", (req, res) => {
  setTimeout(() => {
    res.send("Hello World!");
  }, 5000);
});

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`);
});
